package com.zzptc.mzb.myapplication124.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.zzptc.mzb.myapplication124.R;
import com.zzptc.mzb.myapplication124.entity.QicheGuzhuang;

import java.util.List;

public class QICheGuAdapter extends ArrayAdapter {
    int resourceid;
    List<QicheGuzhuang>list;
    public QICheGuAdapter(@NonNull Context context, int resource, @NonNull List objects) {
        super(context, resource, objects);
        this.resourceid=resource;
        this.list=objects;
    }

    @Override
    public View getView(int position,  View convertView,  ViewGroup parent) {

        if (convertView==null){
            convertView= LayoutInflater.from(getContext()).inflate(resourceid,null);

        }
        TextView tv_code=convertView.findViewById(R.id.tv_code);
        TextView tv_sycx=convertView.findViewById(R.id.tv_sycx);
        TextView tv_zwhy=convertView.findViewById(R.id.tv_zwhy);
        TextView tv_gzhy=convertView.findViewById(R.id.tv_gzfw);
        TextView tv_ms=convertView.findViewById(R.id.tv_ms);
        QicheGuzhuang resultDT0= (QicheGuzhuang) getItem(position);
        tv_code.setText(resultDT0.getResult().getCode());
       tv_sycx.setText(resultDT0.getResult().getSycx());
        tv_zwhy.setText(resultDT0.getResult().getZwhy());
        tv_gzhy.setText(resultDT0.getResult().getGzfw());
        tv_ms.setText(resultDT0.getResult().getMs());
        return super.getView(position, convertView, parent);

    }
}
